<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:o="http://openfaces.org/"
	xmlns:richx="http://richfaces.org/richx">

	<rich:modalPanel id="msgPanel" width="350" height="100" zindex="20500" autosized="true">
		<f:facet name="header">
			<h:panelGroup>
				<h:outputText value="SIGIT"></h:outputText>
			</h:panelGroup>
		</f:facet>
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/close.png" styleClass="hidelink"
					id="hidelink" />
				<rich:componentControl for="msgPanel" attachTo="hidelink"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>

			
		<table width="100%">
			<tr>
				<td width="10%" align="center">
					<h:graphicImage value="/img/error.gif" />
				</td>
				<td width="90%">
					<rich:messages showSummary="true" showDetail="false"/>
					<strong>Detalle:</strong>
					<rich:messages showSummary="false" showDetail="true"/>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input type="button" value="#{messages['button.ok']}" onclick="#{rich:component('msgPanel')}.hide();"/>
					<!-- a4j:commandButton value="#{messages['button.ok']}" onclick="" immediate="true"/-->
				</td>
			</tr>
		</table>
	</rich:modalPanel>

	<a4j:outputPanel ajaxRendered="true">
		<rich:modalPanel id="confirmation-dialog" resizeable="false" autosized="false"
			minWidth="#{dialogHelper.width}" minHeight="#{dialogHelper.height}"
			moveable="#{dialogHelper.moveable}" shadowOpacity="1" zindex="#{dialogHelper.zIndex}">
			<f:facet name="header">#{messages['txt.confirm_dlg']}</f:facet>
			<div align="center">
				<br />
				<h:outputText value="#{dialogHelper.confirmMsg}" />
				<br />
				<br />
				<h:outputText value="#{messages['txt.confirm_question']}" />
				<br />
				<br />
				<br />
				
				<h:form>
					<a4j:commandButton
						value="#{messages['button.ok']}"
						rendered="#{dialogHelper.serverAction}"
						action="#{dialogHelper.doConfirmAction()}"
						onclick="#{rich:component('confirmation-dialog')}.hide();">
					</a4j:commandButton>
					
					<o:commandButton
						value="#{messages['button.ok']}"
						rendered="#{not dialogHelper.serverAction}"
						onclick="#{dialogHelper.jsFunction}"
						type="button">
					</o:commandButton>
					
					<o:commandButton
						value="#{messages['button.cancel']}"
						onclick="#{rich:component('confirmation-dialog')}.hide()"
						type="button">
					</o:commandButton>
				</h:form>
			</div>
		</rich:modalPanel>

		<rich:modalPanel id="strict-confirmation-dialog" resizeable="false" autosized="false"
			minWidth="#{dialogHelper.width}" minHeight="#{dialogHelper.height}"
			moveable="#{dialogHelper.moveable}" shadowOpacity="1" zindex="#{dialogHelper.zIndex}">
			<f:facet name="header">#{messages['txt.confirm_dlg']}</f:facet>
			<div align="center">
				<h:outputText value="#{dialogHelper.confirmMsg}" />
				<br />
				<br />
				<br />
				
				<h:form>
					<h:selectBooleanCheckbox id="chkConfirm" value="#{dialogHelper.actionConfirmed}"/>
					<h:outputLabel value="#{messages['txt.confirm_check']}" for="chkConfirm" />
					
					<br />
					<br />
					
					<a4j:commandButton
						value="#{messages['button.ok']}"
						rendered="#{dialogHelper.serverAction}"
						action="#{dialogHelper.doConfirmAction()}"
						onclick="#{rich:component('strict-confirmation-dialog')}.hide();">
					</a4j:commandButton>
					
					<o:commandButton
						value="#{messages['button.ok']}"
						rendered="#{not dialogHelper.serverAction}"
						onclick="if (#{rich:element('chkConfirm')}.checked) #{dialogHelper.jsFunction}; #{rich:component('strict-confirmation-dialog')}.hide();"
						type="button">
					</o:commandButton>
				</h:form>
			</div>
		</rich:modalPanel>
	</a4j:outputPanel>


	<ui:remove>
	<rich:modalPanel id="verDocPanel" autosized="true">
		<f:facet name="header">
			<h:outputText value="Documento"/>
		</f:facet>
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/close.png" styleClass="hidelink"
					id="hideDocPanel" />
				<rich:componentControl for="verDocPanel" attachTo="hideDocPanel"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		<h:form id="docForm">
			<a4j:mediaOutput id="pdfOut" name="pdfOut" rendered="false"
			 uriAttribute="data"
			 element="object"
			 width="800"
			 height="600"
			 createContent="#{documentViewer.viewFile}"
			 mimeType="application/pdf"
			 standBy="loading..."/>
 		</h:form>
		<script type="text/javascript">
		document.getElementById("docForm:pdfOut").type="application/pdf";
		</script>
 	</rich:modalPanel>
 	</ui:remove>


</ui:component>
